home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Plus Special 22
/
AMIGAplus Sonderheft 22 (2000)(Falke)(DE)(Track 1 of 4)[!].iso
/
Rexx
/
TalkingClock.rexx
< prev
next >
Wrap
OS/2 REXX Batch file
|
1999-11-06
|
2KB
|
68 lines
/* HOURLY TALKING CLOCK AREXX SCRIPT v1.0
** TO MAKE IT ANNOUNCE MINUTES, UNCOMMENT LINE 14 WHILE COMMENTING OUT LINE 15
** Heavily modified by Gene Heskett for minutes functions, a bad hack! */
LF= '0a'x
thetime = time(c)
parse var thetime hour':'minute
apm = right(minute,2)
minute = left(minute,2)
minute2 = left(minute,1)
minute1 = right(minute,1)
if apm = 'AM' then apm = ' aye M'
if apm = 'PM' then apm = ' pee M'
if hour = '1' then hour = 'won'
if hour = '2' then hour = 'two'
if hour = '3' then hour = 'three'
if hour = '4' then hour = 'phor'
if hour = '5' then hour = 'five'
if hour = '6' then hour = 'six'
if hour = '7' then hour = 'seven'
if hour = '8' then hour = 'ate '
if hour = '9' then hour = 'nine'
if hour = '10' then hour = 'ten'
if hour = '11' then hour = 'elaven'
if hour = '12' then hour = 'twelve'
/* first, a special case for all balls */
if minute = '00' then do
minute2 = ''
minute1 = ''
end
/* not all balls, are we in the 'teens'? */
else do
if minute2 = '1' then do
if minute1 = '0' then minute2 = ' ten '
if minute1 = '1' then minute2 = ' elaven '
if minute1 = '2' then minute2 = ' twelve '
if minute1 = '3' then minute2 = ' thirt teen '
if minute1 = '4' then minute2 = ' phour teen '
if minute1 = '5' then minute2 = ' fif teen '
if minute1 = '6' then minute2 = ' sixt teen '
if minute1 = '7' then minute2 = ' seven teen '
if minute1 = '8' then minute2 = ' ate teen '
if minute1 = '9' then minute2 = ' nine teen '
minute1 = ''
end
/* not teens, handle 0-2,3,4,5 in minute2 (tens) */
else do
if minute2 = '2' then minute2 = ' twentee '
if minute2 = '3' then minute2 = ' thirtee '
if minute2 = '4' then minute2 = ' phourtee '
if minute2 = '5' then minute2 = ' fiftee '
if minute2 = '0' then minute2 = ' oh '
/* now do remaining single minutes */
if minute1 = '0' then minute1 = ''
if minute1 = '1' then minute1 = ' won '
if minute1 = '2' then minute1 = ' two '
if minute1 = '3' then minute1 = ' three '
if minute1 = '4' then minute1 = ' phour '
if minute1 = '5' then minute1 = ' five '
if minute1 = '6' then minute1 = ' six '
if minute1 = '7' then minute1 = ' seven '
if minute1 = '8' then minute1 = ' ate '
if minute1 = '9' then minute1 = ' nine '
end
end
address command 'echo >speak: "it is "' hour minute2 minute1 apm